package com.example.api.mq;

import org.springframework.amqp.rabbit.annotation.EnableRabbit;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;

@EnableRabbit//启动rabbit功能，
//RabbitAutoConfiguration自动生效，容器自动注入RabbitTemplate，AmqpAdmin,
// CachingConnectionFactory, RabbitMessageTemplate
@SpringBootApplication(exclude= {DataSourceAutoConfiguration.class})
//不加exclude，启动会报错: Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.
//应该是因为引入的其他包包含mybatis-plus，所以需要配置数据库
public class MqApplication {

    public static void main(String[] args) {
        SpringApplication.run(MqApplication.class, args);
    }

}
